package play.modules.market;

public class MarketProfile {
	/** The id. */
	private String id;
	
	/** The email. */
	private String email;
	
	/** The first name. */
	private String firstName;
	
	/** The last name. */
	private String lastName;
	
	/** The domain of the user. */
	private String domain;
	
	/** The admin flag. */
	private Boolean admin;
	
	public MarketProfile() {}
	
	public MarketProfile(String id, String email, String firstName, String lastName) {
		this.id = id;
		this.email = email;
		this.firstName = firstName;
		this.lastName = lastName;
	}

	
	public MarketProfile(String id, String email, String firstName, String lastName, String domain) {
		this(id, email, firstName, lastName);
		this.domain = domain;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getDomain() {
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}
	
	public void setAdmin(Boolean admin) {
		this.admin = admin;
	}
	
	public Boolean isAdmin() {
		return this.admin;
	}
	
	public String getUserName() {
		return getEmail().substring(0, getEmail().indexOf("@"));
	}
}
